import request from '@/utils/request'
// 查询数据源列表
export function listDatasource(query) {
  return request({
    url: '/dbDatasource',
    method: 'get',
    params: query
  })
}

//测试数据库连接
export function testConnect(data){
  return request({
    url: '/dbDatasource/test',
    method: 'post',
    data: data
  })

}

//更新数据源
export function updateDataSource(data){
  return request({
    url: '/dbDatasource',
    method: 'put',
    data: data
  })
}

//新增数据源
export function addDataSource(data){
  return request({
    url: '/dbDatasource/addNew',
    method: 'post',
    data: data
  })
}

//删除数据源
export function delDataSource(id){
  return request({
    url: '/dbDatasource?idList=' + id,
    method: 'delete'
  })
}
